<template>
	 <div class="swiper-container header-swipers">
				 <div class="swiper-wrapper">
					 <div class="swiper-slide" v-for="item in swiperList" :key="item.id">
						 <img :src="item.imgURL">
					 </div>
				 </div>
			 </div>
</template>

<script>
	import Swiper from "swiper";
	export default{
		props:['swiperList'],
		data(){
			return{
				//当数据中需要加载文件的路径作为元素时,一定要加上require
				// swiperList:[
				// 	{id:1,imgURL:require('@/assets/img/1.jpg')},
				// 	{id:2,imgURL:require('@/assets/img/2.jpg')},
				// 	{id:3,imgURL:require('@/assets/img/3.jpg')},
				// 	{id:4,imgURL:require('@/assets/img/4.jpg')},
				// 	{id:5,imgURL:require('@/assets/img/5.jpg')},
				// ]
			}
		},
			mounted(){
					new Swiper('.header-swipers' ,{
						loop : true,
						observer : true,
						observeParent : true
					})
				}
	}
</script>

<style scoped>
	.header-swipers{
		width: 100%;
		height: 4.18rem;
		overflow: hidden;
	}
	.header-swipers img{
		width: 100%;
		height: 100%;
	}
</style>
